<!DOCTYPE html>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户注册</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">


<link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
<style type="text/css">
    input::-webkit-input-placeholder{
        color:#cccccc;
    }
    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
        -webkit-appearance: none !important;
        margin: 0;
    }
</style>
<script type='text/javascript'>
(function($) {
    $.fn.ajaxSubmit = function(options) {
        var form = this;

        var formAction = form.attr('action');
        var formMethod = form.attr('method');
        if(formMethod == null ||
                !/^(POST|GET)$/i.test(formMethod.trim())){
            formMethod = "GET";
        }
        var params = new Object();

        /*组合参数*/
        var items = form.find("input[type=hidden],"+
                "input[type=text],"+
                "input[type=number],"+
                "input[type=password],"+
                "textarea,"+
                "select,"+
                "input[type=radio]:checked,"+
                "input[type=checkbox]:checked");

        items.each(function(index){
            params[this.name] = this.value;
        });
        /**/

        var dataType = options.dataType;
        if(dataType == null)
            dataType = 'json';

        var success = options.success;
        if(success == null){
            success = function(){
            };
        }

        $.ajax({
            type: formMethod,
            url: formAction,
            data: params,
            dataType: dataType,
            success: success
        });
    };
})(Zepto);

$(function () {
    $.config = {
        router: false
    }
    $.init();
})


function checkform() {
    if ($.trim($("#username").val()).length == 0) {

        $.toast("请输入用户名");

        return false;
    }

    if ($.trim($("#password").val()).length == 0) {
        $.toast("请输入密码");
        return false;
    }

    if ($.trim($("#password").val()) !=$.trim($("#repassword").val())) {
        $.toast("两遍密码不一致");
        return false;
    }

    if ($.trim($("#nickname").val()).length == 0) {
        $.toast("请输入姓名");
        return false;
    }

    if ($.trim($("#company").val()).length == 0) {
        $.toast("请输入公司名");
        return false;
    }

    if ($.trim($("#job").val()).length == 0) {
        $.toast("请输入部门/职务");
        return false;
    }

    if ($.trim($("#mobile").val()).length == 0) {
        $.toast("请输入手机号");
        return false;
    }

    if ($.trim($("#email").val()).length == 0) {
        $.toast("请输入邮箱");
        return false;
    }
    var re = /^1\d{10}$/;
    if (re.test($("#mobile").val())!=true) {
        $.toast("请正确输入手机号");
        return false;
    }

    var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
    if (reg.test($("#email").val())!=true) {
        $.toast("请正确输入邮箱");
        return false;
    }

    form1.submit();
}





</script>
</head>


<body>
<div class="page page-current" id='router'>
    <div class="card" style="margin:0;box-shadow:none;">

        <div class="card-content">

            <div class="list-block media-list">
                <ul>
                    <li style="padding-top: .75rem;padding-left: 1rem;" class="item-content">

                        <div class="item-inner">
                            <div class="item-title-row">
                                <div class="item-title"><font size="6em">用户注册</font></div>
                            </div>

                        </div>
                    </li>
                </ul>
            </div>
        </div>

    </div>
    <form action="{:U('register')}" method="post" name="form1" id="form1">
        <input type="hidden" name="reg_type" value="web">
        <div class="card" style="margin:0.5rem 0 0 0;box-shadow:none;">
            <div class="list-block">
                <ul>
                    <!-- Text inputs -->
                    <li>
                        <div class="item-content">

                            <div class="item-inner">
                                <div class="item-input">
                                    <input type="text" name="username" id="username"  placeholder="用户名">
                                </div>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="item-content">

                            <div class="item-inner">
                                <div class="item-input">
                                    <input type="password" name="password" id="password"  placeholder="登录密码">
                                </div>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="item-content">

                            <div class="item-inner">
                                <div class="item-input">
                                    <input type="password" name="repassword" id="repassword"  placeholder="再输一次登录密码">
                                </div>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="item-content">

                            <div class="item-inner">
                                <div class="item-input">
                                    <input type="text" name="nickname" id="nickname"  placeholder="姓名">
                                </div>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="item-content">

                            <div class="item-inner">
                                <div class="item-input">
                                    <input type="text" name="company" id="company"  placeholder="公司">
                                </div>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="item-content">

                            <div class="item-inner">
                                <div class="item-input">
                                    <input type="text" name="job" id="job"  placeholder="部门/职务">
                                </div>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="item-content">

                            <div class="item-inner">
                                <div class="item-input">
                                    <input type="text" name="mobile" id="mobile"  placeholder="手机号">
                                </div>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="item-content">

                            <div class="item-inner">
                                <div class="item-input">
                                    <input type="text" name="email" id="email"  placeholder="邮箱">
                                </div>
                            </div>
                        </div>
                    </li>

                </ul>
            </div>
            <div class="content-block">
                <div class="row">
                    <div class="col-100"><a href="#" onclick="javascript:checkform();" class="button button-big button-fill button-success" style="background-color: #c4863d;">注册</a></div>
                </div>
            </div>
            <div class="content-block" style="text-align:right;">
                <a href="{:U('login')}">立即登录</a>
            </div>
        </div>
    </form>
</div>
</body>

</html>
